package com.wzdigit.wms.basic.client.request.basic;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 批量新增/修改/删除 库区属性输入
 * @author yangdongjie
 * @CreateWarehouseAttrRequest.java
 * @2020年12月31日下午5:39:24
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"}, ignoreUnknown = true)
public class CreateUpdateListZoneAttrRequest implements Serializable {

	private static final long serialVersionUID = -1867576575934932547L;

	/**
	 * 库区ID
	 */
	@ApiModelProperty(value = "库区ID", required = true)
    @NotNull(message = "库区ID不能为空！")
	private Integer zoneId;
	
	/**
	 * 库区属性列表
	 */
	@ApiModelProperty(value = "库区属性列表", required = true)
	@Valid
	private List<CreateUpdateZoneAttrRequest> zoneAttrs;
	
	// 内部类
	@Data
	@JsonInclude(JsonInclude.Include.NON_NULL)
	@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"}, ignoreUnknown = true)
	public static class CreateUpdateZoneAttrRequest implements Serializable {

		private static final long serialVersionUID = -7263561335755801606L;

		/**
		 * 库区属性ID
		 */
		@ApiModelProperty(value = "库区属性ID", required = false)
		private Integer zoneAttrId;
		
		/**
		 * 库区ID
		 */
		/*@ApiModelProperty(value = "库区ID", required = true)
	    @NotNull(message = "库区ID不能为空！")
		private Integer zoneId;*/

		/**
		 * 属性
		 */
		@ApiModelProperty(value = "属性", required = true)
	    @NotBlank(message = "属性不能为空！")
		private String attr;

		/**
		 * 值
		 */
		@ApiModelProperty(value = "值", required = true)
	    @NotBlank(message = "值不能为空！")
		private String value;

		/**
		 * 备注
		 */
		@ApiModelProperty(value = "备注", required = false)
		private String comments;

		/**
		 * 是否有效
		 */
		@ApiModelProperty(value = "是否有效", required = true)
	    @NotNull(message = "是否有效不能为空！")
		@Range(min = 0, max = 1, message = "是否有效错误")
		private Integer isEnabled;

	}
}